<case value="customer">
	<input id="username_text" type="hidden" name="{$[type]form.name}" value="{$[type]form.value}"/>
	<php>
		if($form['value']){
			$usrename = M('customer')->where("id=$form[value]")->getField('customer_num');
		}
	</php>
    <input type="text" class="form-control input text" name="{$[type]form.name}_num" value="{$usrename}" onblur="get_customer_id(this.value);" {$[type]form.extra_attr}>
    	<script>
    		function get_customer_id(customer){
    			$.ajax({
				   type: "POST",
				   url: "{:U('/admin/ajax/get_customer_id')}",
				   data: "customer_num="+customer,
				   success: function(msg){
				     $("#username_text").val(msg);
				   }
				});
    		}
    	</script>
</case>